﻿Console.WriteLine("Welcome to the Calculator");
Console.WriteLine("Input the first number:");
int firstNumber = int.Parse(Console.ReadLine());

Console.WriteLine("Input the second number:");
int secondNumber = int.Parse(Console.ReadLine());

Console.WriteLine("What do you want to do?");
Console.WriteLine("[A]dd numbers");
Console.WriteLine("[S]ubtract numbers");
Console.WriteLine("[M]ultiply numbers");

string userInput = Console.ReadLine();

if (EqualsCaseInsensitive(userInput,"A"))
{
    PrintFinalEqualtion(firstNumber,secondNumber,firstNumber + secondNumber ,"+");
}
else if(EqualsCaseInsensitive(userInput,"S"))
{
    PrintFinalEqualtion(firstNumber,secondNumber,firstNumber - secondNumber,"-");
}
else if(EqualsCaseInsensitive(userInput,"M"))
{
    PrintFinalEqualtion(firstNumber, secondNumber, firstNumber * secondNumber,"*" );
}
else
{
    Console.WriteLine("Invalid choice!");
}

Console.ReadKey();

void PrintFinalEqualtion(int firstNum, int secondNum, int result, string @operator)
{
    Console.WriteLine(firstNum + " " + @operator + " " + secondNum + " = " + result);
}

bool EqualsCaseInsensitive(string left, string right)
{
    return left.ToUpper() == right.ToUpper();
}